package com.itheima.mapper.admin;


import com.itheima.pojo.admin.Order;
import com.itheima.pojo.admin.orderdto.OrderPaginationDto;
import com.itheima.pojo.admin.orderdto.OrderStatusUpdateByIdDto;
import com.itheima.pojo.client.OrderAddDto;
import com.itheima.pojo.client.orderPaginationVo.OrderWaresAdd;
import com.itheima.pojo.client.orderPaginationVo.OrderPaginationVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ChenJunJie
 * @date 2022/6/13 16:19
 * 订单的mapper层
 */
@Mapper
public interface OrderMapper {

    // 订单分页查询
    List<Order> orderPagination (OrderPaginationDto dto);

    // 通过时间与订单号查询订单
    List<Order> orderSelectByTimeAndNumber (OrderPaginationDto dto);

    //修改订单状态
    int orderStatusUpdateById(OrderStatusUpdateByIdDto orderStatus);

    //提交订单(添加订单)
    int addOrder(OrderAddDto orderAddDto);

    //移动端查询订单分页
    List<OrderPaginationVo> cilentOrderPagination(@Param("page") Integer page, @Param("pageSize") Integer pageSize,@Param("id") String id);

    //查询所有的订单
    List<OrderPaginationVo> selectOrderAll(@Param("id") String id);

    //新增订单关系
    int orderWaresAdd (List<OrderWaresAdd> orderWaresAdd);

    //通过订单id查询订单关系
    List<OrderWaresAdd> orderWaresSelectById(@Param("id") String id);

}
